﻿using System;
using System.Collections.Generic;
using System.Text;
using XmHttpServer.Rest;
using XmHttpServer;

namespace XmHttpServerForm
{
    public class TestService : IRestService
    {
        /// <summary>
        /// 用于测试
        /// </summary>
        /// <returns></returns>
        [RestMethod(HttpVerb.Get, "用于测试")]
        public string forTest(string input)
        {
            return "input输入为：" + input;
        }
        /// <summary>
        /// 用于测试
        /// </summary>
        /// <returns></returns>
        [RestMethod(HttpVerb.Get, "用于测试")]
        [Xml]
        public string test(string input, HttpContext context)
        {

            return "test输入为：" + input + "<br>" + context.Request.QueryString;
        }

        /// <summary>
        /// 用于测试bean
        /// </summary>
        /// <returns></returns>
        [RestMethod(HttpVerb.Get, "用于测试bean")]
        [Json]
        public TestBean testBean(string id, string name, HttpContext context)
        {
            TestBean testBean = new TestBean();
            testBean.Id = id;
            testBean.Name = name;
            return testBean;
        }


    }
}
